﻿/**
 *
 * @file FITKAbaqusHDF5AdaptorSectionAssign.h
 * @brief 读写HDF5文件的SectionAssign类
 * @author fulipeng (fulipengqd@yeah.net)
 * @date 2024-06-05
 *
 */
#ifndef  _FITKABAQUSHDF5ADAPTORSECTIONASSIGN_H__
#define  _FITKABAQUSHDF5ADAPTORSECTIONASSIGN_H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Interface/FITKInterfaceIOHDF5/FITKInterfaceHDF5AdaptorSectionAssign.h"

 //前置声明
ForwardDeclarNS(Interface, FITKSectionAssign)
ForwardDeclarNS(Interface, FITKAbstractSection)
ForwardDeclarNS(Interface, FITKAbstractMaterial)
ForwardDeclarNS(Interface, FITKAbaAbastractSectionAssign)

namespace IO
{
    /**
     * @brief HDF5 SectionAssign 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-06-07
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorSectionAssign : public FITKInterfaceHDF5AdaptorSectionAssign
    {
    public:
        explicit FITKAbaqusHDF5AdaptorSectionAssign() = default;
        virtual ~FITKAbaqusHDF5AdaptorSectionAssign() = default;

        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        bool adaptW() override;

    protected:

        /**
         * @brief   读取截面指派
         * @param   section 截面指派
         * @param   h5Group 数据块
         * @return  状态 true成功， false失败
         * @author  fulipeng (fulipengqd@yeah.net)
         * @date    2024-05-30
         */
        virtual bool readSectionAssign(Interface::FITKSectionAssign* section, H5::Group& h5Group) override;

        /**
         * @brief   读取截面指派-Beam
         * @param   section 截面指派
         * @param   h5Group 数据块
         * @return  状态 true成功， false失败
         * @author  fulipeng (fulipengqd@yeah.net)
         * @date    2024-05-30
         */
        bool readSectionAssignBeam(Interface::FITKSectionAssign* section, H5::Group& h5Group);

        /**
         * @brief   读取截面指派-SolidHomogenous
         * @param   section 截面指派
         * @param   h5Group 数据块
         * @return  状态 true成功， false失败
         * @author  fulipeng (fulipengqd@yeah.net)
         * @date    2024-05-30
         */
        bool readSectionAssignSolidHomogenous(Interface::FITKSectionAssign* section, H5::Group& h5Group);

        /**
         * @brief   读取截面指派-ShellHomogenous
         * @param   section 截面指派
         * @param   h5Group 数据块
         * @return  状态 true成功， false失败
         * @author  fulipeng (fulipengqd@yeah.net)
         * @date    2024-05-30
         */
        bool readSectionAssignShellHomogenous(Interface::FITKSectionAssign* section, H5::Group& h5Group);

        /**
         * @brief   写出截面指派
         * @param   section 截面指派
         * @param   h5Group 数据块
         * @return  状态 true成功， false失败
         * @author  fulipeng (fulipengqd@yeah.net)
         * @date    2024-05-30
         */
        virtual bool writeSectionAssign(Interface::FITKSectionAssign* section, H5::Group& h5Group) override;
        
        /**
         * @brief   写出截面指派-Beam
         * @param   section 截面指派
         * @param   h5Group 数据块
         * @return  状态 true成功， false失败
         * @author  fulipeng (fulipengqd@yeah.net)
         * @date    2024-05-30
         */
        bool writeSectionAssignBeam(Interface::FITKSectionAssign* section, H5::Group& h5Group);
        
        /**
         * @brief   写出截面指派-SolidHomogenous
         * @param   section 截面指派
         * @param   h5Group 数据块
         * @return  状态 true成功， false失败
         * @author  fulipeng (fulipengqd@yeah.net)
         * @date    2024-05-30
         */
        bool writeSectionAssignSolidHomogenous(Interface::FITKSectionAssign* section, H5::Group& h5Group);
        
        /**
         * @brief   写出截面指派-ShellHomogenous
         * @param   section 截面指派
         * @param   h5Group 数据块
         * @return  状态 true成功， false失败
         * @author  fulipeng (fulipengqd@yeah.net)
         * @date    2024-05-30
         */
        bool writeSectionAssignShellHomogenous(Interface::FITKSectionAssign* section, H5::Group& h5Group);

    };

    Register2FITKIOAdaptorFactory(HDF5, Interface::FITKAbaAbastractSectionAssign, FITKAbaqusHDF5AdaptorSectionAssign)

}

#endif
